<template>
	<view>
		<view class="info">
			<view class="title">{{newsInfo.title}}</view>
			<view class="detail">
				<text>发表时间：{{newsInfo.add_time | formatDate}}</text>
				<text>浏览：{{newsInfo.click}}</text>
			</view>
		</view>
		<view class="content" v-html="newsInfo.content"></view>
		<!-- <rich-text :nodes="newsInfo.content"></rich-text> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				newsInfo:[]
			};
		},
		onLoad(options) {
			//'/api/getnew/'+id
			this.getNewsInfo(options.id)
		},
		methods:{
			async getNewsInfo(id){
				const res = await this.$request({url:"/api/getnew/"+id})
				this.newsInfo=res.data.message[0]
			}
		}
	}
</script>

<style lang="scss">
.info{
	border-bottom: 1px solid $color;
	padding: 5px;
	.title{
		text-align: center;
		font-weight: 600;
	}
	.detail{
		font-size: 12px;
		color: #ccc;
		display: flex;
		justify-content: space-between;
	}
}
</style>
